import { useRouter } from "vue-router";
import { useUserStore } from "../store/user";

export const useLogout = function (routerName) {
  const router = useRouter();
  return {
    logout() {
      useUserStore().removeUser();
      router.push({
        name: routerName ? routerName : "Login",
      });
    },
  };
};
